<?php
/**
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
$cakeDescription = __d('cake_dev', 'Tiendas ROCKY - Administrador');
$this->requestaction('/Usuarios/verificarAdmin');
$administrador = $this->Session->read('administrador');
$id = $administrador['Administradore']['id'];
?>
<!DOCTYPE html>
<html>
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php echo $cakeDescription ?>
	</title>
	<?php
		echo $this->Html->meta('icon');

		echo $this->Html->css('cake.generic'); 
		echo $this->Html->css('menu');
		echo $this->Html->css('style');
		//echo $this->Html->css('formulario');

		echo $this->Html->css('jquery.dataTables');
		echo $this->Html->css('jquery-ui');
		echo $this->Html->css('TableTools');

		echo $this->Html->script('jquery-1.9.1');
		echo $this->Html->script('jquery-ui-1.9.2.custom');
		echo $this->Html->script('jquery.dataTables');
		echo $this->Html->script('TableTools');
		echo $this->Html->script('ZeroClipboard');

		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('script');
	?>
<script type="text/javascript">
	function addCommas(nStr) {
		nStr += '';
		x = nStr.split('.');
		x1 = x[0];
		x2 = x.length > 1 ? '.' + x[1] : '';
		var rgx = /(\d+)(\d{3})/;
		while (rgx.test(x1)) {
			x1 = x1.replace(rgx, '$1' + ',' + '$2');
		}
		return x1 + x2;
	}

    jQuery.extend( jQuery.fn.dataTableExt.oSort, {
        "formatted-num-pre": function ( a ) {
            a = a.replace( 'S/. ', '' );
            return parseFloat( a ).toFixed(2);
        },
        "formatted-num-asc": function ( a, b ) {
            return a - b;
        },
        "formatted-num-desc": function ( a, b ) {
            return b - a;
        }
    } );
</script>
</head>
<body id="bodyadm">
<div align="center">
	<div id="container" style="width:1100px;">
		<div id="header">
			<!--h1><?php echo $this->Html->link($cakeDescription, 'http://cakephp.org'); ?></h1-->
		</div>
		<div id='cssmenu'>
		<ul>
		   <li><a href='../Pages/inicio'><span>INICIO</span></a></li>
		   <li><!--a href='../Tiendas/listar'><span>TIENDAS</span></a-->
			<?php echo $this->Html->link('TIENDAS', array('controller'=>'Tiendas','action'=>'listar')); ?>
		   </li>
		   <li><a href='../Vendedores/listar'><span>USUARIOS</span></a></li>
		   <li><a href='../Productos/listar'><span>PRODUCTOS</span></a></li>
		   <li><a href='../Ventas/listar'><span>VENTAS</span></a></li>
		   <li class='last' style="cursor:pointer;"><a onclick="$('#editmenu').toggle('slow');"><span>EDITAR PERFIL</span></a></li>
			<div style="position:fixed;z-index:999">
				<div id="editmenu" style="display:none;position:absolute;left:523px;top:30px;background:url('../css/images/blueprint.png')#fff;border:1px solid #ccc;border-radius:5px;width:135px;padding:8px;text-align:left;font-weight:bold;">
					<div style="background:#f4f4f4;border:1px solid #ccc;border-radius:5px;width:118px;padding:8px;text-align:left;font-weight:bold;">
						<div><a onmouseover="this.style.textDecoration='underline'" onmouseout="this.style.textDecoration='none'"  href="../Administradores/editar?id=<?php echo $id; ?>">Editar Perfil</a></div>
						<div style="padding-top:10px"><a onmouseover="this.style.textDecoration='underline'" onmouseout="this.style.textDecoration='none'" href="../Administradores/contrasena?id=<?php echo $id; ?>">Cambiar Contrase&ntilde;a</a></div>
					</div>
				</div>
			</div>
		   <li style="float:right;border-left:1px solid #1C2B37;margin-right:1px;"><a style="border-left:1px solid #444;border-radius:0 0 5px 0;" href='../Usuarios/cerrar'><span>CERRAR SESIÓN</span></a></li>
		</ul>
		</div>
		<div id="content" align="center" style="min-height:425px;">
	        <?php echo $this->Session->flash(); ?>
			<?php echo $this->fetch('content'); ?>
		</div>
		<div id="footer">
			<p style="float: right" >TIENDAS ROCKY ® Copyright © <?php echo date('Y'); ?>. Todos los Derechos Reservados</p>
			<p style="float: left" >
			<?php
				date_default_timezone_set("America/Lima");
				$dias = array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado");
				$meses = array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
				echo $dias[date('w')]." ".date('d')." de ".$meses[date('n')-1]. " del ".date('Y') ;
			?>
			</p>
		</div>
	</div>
</div>
	<?php echo $this->element('sql_dump'); ?>
</body>
</html>